﻿using System;

namespace Utilities.Settings {
    public static class scSettingsAccess {

        private static cSettingsOrganizer oSettingsOrganizer;

        private static cSettingsOrganizer getSingletonAccess() {
            if (oSettingsOrganizer != null) return oSettingsOrganizer;
            else { oSettingsOrganizer = new cSettingsOrganizer(); return oSettingsOrganizer; }
        }

        public static void Flag_Set_AutoSave(bool bFlag) {
            getSingletonAccess().Flag_Set_AutoSave(bFlag);
        }

        public static Boolean Flag_Get_LoadedFromFile() {
            return getSingletonAccess().Flag_Get_LoadedFromFile();
        }

        public static Boolean Flag_Get_ChangedSinceLoad() {
            return getSingletonAccess().Flag_Get_ChangedSinceLoad();
        }

        public static Boolean Flag_Get_ChangedSinceSave() {
            return getSingletonAccess().Flag_Get_ChangedSinceSave();
        }

        public static bool Settings_Load(string sFilename) {
            return getSingletonAccess().Settings_Load(sFilename);
        }

        public static bool Settings_Save(string sFilename) {
            return getSingletonAccess().Settings_Save(sFilename);
        }

        public static bool Settings_AutoSave() {
            return getSingletonAccess().Settings_AutoSave();
        }

        public static bool Setting_Set(string sName, string sValue) {
            return getSingletonAccess().Setting_Set(sName, sValue);
        }

        public static bool Setting_Set_IfNotExist(string sName, string sValue) {
            return getSingletonAccess().Setting_Set_IfNotExist(sName, sValue);
        }

        public static string Setting_Get(string sName) {
            return getSingletonAccess().Setting_Get(sName);
        }

        public static bool Setting_Delete(string sName) {
            return getSingletonAccess().Setting_Delete(sName);
        }
    }
}
